*
* $Id$
*
* $Log: getnu.F,v $
* Revision 1.1.1.1  2002/06/16 15:18:43  hristov
* Separate distribution  of Geant3
*
* Revision 1.1.1.1  1999/05/18 15:55:21  fca
* AliRoot sources
*
* Revision 1.1.1.1  1995/10/24 10:21:56  cernlib
* Geant
*
*
#include "geant321/pilot.h"
*CMZ :  3.21/02 29/03/94  15.41.48  by  S.Giani
*-- Author :
      SUBROUTINE GETNU(D,LD,E,LEN,XNU)
C       THIS ROUTINE SELECTS THE AVERAGE NUMBER OF NEUTRONS
C       BORN FROM A FISSION REACTION (I.E. NU-BAR)
#include "geant321/minput.inc"
      DIMENSION D(*),LD(*),C(4)
      SAVE
      IP=1
      XNU=0.0
      LNU=LD(IP)
      IP=IP+1
      IF(LNU.NE.1)GO TO 30
C       POLYNOMIAL REPRESENTATION USED TO SPECIFY NU-BAR
C       INITIALIZE THE POLYNOMIAL COEFFICIENTS TO ZERO
      DO 10 I=1,4
         C(I)=0.0
   10 CONTINUE
      NC=LD(IP)
      DO 20 I=1,NC
         C(I)=D(IP+I)
   20 CONTINUE
C       CALCULATE NU-BAR USING POLYNOMIAL COEFFICIENTS
      XNU=C(1)+C(2)*E+C(3)*(E**2)+C(4)*(E**3)
      RETURN
C       TABULATED DATA USED TO SPECIFY NU-BAR
C       CURRENT ENDF/B DATA (VERSION V) ALLOWS ONLY ONE
C       INTERPOLATION RANGE (NR) AND ONLY LINEAR-LINEAR
C       INTERPOLABLE DATA (INT=2)
   30 IF(LNU.NE.2)GO TO 40
      NR=LD(IP)
      NP=LD(IP+1)
      IP=IP+2*NR+2
C       SELECT NU-BAR FROM THE TABULATED DATA
C       LINEAR-LINEAR INTERPOLATION IS ASSUMED AT THIS POINT
      CALL TBSPLT(D(IP),E,NP,XNU)
      RETURN
   40 WRITE(IOUT,10000)LNU
10000 FORMAT(' MICAP: ERROR IN ROUTINE GETNU; LNU=',I3)
      WRITE(6,*) ' CALOR: ERROR in GETNU ====> STOP'
      STOP
      END
